<?php

class WSaveMetaInformation extends CWidget
{
	public $pageId='';
	public $language='';
	
	public function run()
	{
		if (empty($this->language))
		{
			$this->language = Yii::app()->language;
		}
		$criteria=new CDbCriteria;
		$criteria->condition = 'pageId=:pageid';
		$criteria->params = array(':pageid'=>$this->pageId);
		
		if (!$settings = SeoSettings::model()->find($criteria))
		{
			$settings['pageId'] = $this->pageId;
		}
		$this->render('saveMetaForm', array('settings'=>$settings));
	}
}?>
